﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace MidSoft.finance
{
    public partial class finance : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            #region 加载菜单
            ChinaSoft.BLL.Common.Bind bllBind = new ChinaSoft.BLL.Common.Bind();
            DataSet ds = bllBind.GetDataSet("*", "V_RolePower", "UserAccount='" + ChinaSoft.Common.Input.SetString(Session["UserAccount"]) + "' and (PowerId  between 13 and 24) order by Sort,CreateTime desc");
            string result = string.Empty;
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    result = GetResult(result, dt.Rows[i]["PowerId"]);
                }
            }
            literMenu.Text = result;
            #endregion
        }

        private string GetResult(string result, object input)
        {
            switch (ChinaSoft.Common.Input.SetInt(input))
            {
                case 13:
                    result += "<li><a href=\"javascript:routeToWorkSpace('/Finance/MainInvoiceList.aspx')\" title='按合同开票'>按合同开票</a></li>";
                    break;
                case 14:
                    result += "<li><a href=\"javascript:routeToWorkSpace('/Finance/MainInvoiceChargeList.aspx')\" title='按发票收款'>按发票收款</a></li>";
                    break;
                case 15:
                    result += "<li><a href=\"javascript:routeToWorkSpace('/Finance/L_MainInvoiceList.aspx')\" title='发票清单'>发票清单</a></li>";
                    break;
                case 16:
                    result += "<li><a href=\"javascript:routeToWorkSpace('/Finance/L_MainInvoiceChargeList.aspx')\" title='收款清单'>收款清单</a></li>";
                    break;
                case 17:
                    result += "<li><a href=\"javascript:routeToWorkSpace('/Finance/ConstractInvoiceCharge.aspx')\" title='合同收款情况'>合同收款情况</a></li>";
                    break;
                case 18:
                    result += "<li><a href=\"javascript:routeToWorkSpace('/Finance/MainInvoiceCharge.aspx')\" title='发票收款情况'>发票收款情况</a></li>";
                    break;
                case 19:
                    result += "<li><a href=\"javascript:routeToWorkSpace('/Finance/SubInvoice/List.aspx')\" title='按合同收票'>按合同收票</a></li>";
                    break;
                case 20:
                    result += "<li><a href=\"javascript:routeToWorkSpace('/Finance/SubInvoicePayMent/List.aspx')\" title='按收票付款'>按收票付款</a></li>";
                    break;
                case 21:
                    result += "<li><a href=\"javascript:routeToWorkSpace('/Finance/SubInvoice/AllList.aspx')\" title='收票清单'>收票清单</a></li>";
                    break;
                case 22:
                    result += "<li><a href=\"javascript:routeToWorkSpace('/Finance/SubInvoicePayMent/AllList.aspx')\" title='付款清单'>付款清单</a></li>";
                    break;
                case 23:
                    result += " <li><a href=\"javascript:routeToWorkSpace('/Finance/ContractSubPayMent.aspx')\" title='合同付款情况'>合同付款情况</a></li>";
                    break;
                case 24:
                    result += "<li><a href=\"javascript:routeToWorkSpace('/Finance/SubInvoicePayMentList.aspx')\" title='收票付款情况'>收票付款情况</a></li>";
                    break;
            }
            return result;
        }
    }
}